home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Online / CNetDemo / cnet / sdk / developerdocs / Mail-Task.doc < prev   
Encoding:
Text File  |  1997-09-04  |  8.2 KB  |  184 lines

  1.                 Specifications for mail filing to mail-task
  2.                 ===========================================
  3.  
  4.                   copyright © 1988-1998 ZenMetal Software
  5.                  Additional copyrights 1988-1998 MetalSoft
  6.  
  7. ** This document is freely distributable to any developer wishing to write
  8. ** mail-processing utilities for CNet Amiga.  The concept of mail-task,
  9. ** it's filing procedures and this document are proprietary to CNet Amiga and
  10. ** are covered under the ZenMetal CNet Amiga copyright.  The use of this
  11. ** concept and code is also granted to Metal Software.
  12.  
  13.  
  14.                  WELCOME TO THE NEXT LEVEL OF CNET AMIGA!
  15.  
  16.  
  17. As of the ZenMetal CNet v4.12b release, mail-task is now a dedicated
  18. inbound/network-outbound mail-server for CNet. It requires TWO files for each
  19. piece of mail.  One is a "header/message" file and the other a list of
  20. intended recipients.  The format of these two files follow:
  21.  
  22. Examples used throughout this document:  12345678.cmh
  23.                                          abcdefgh.mtl
  24.  
  25. The filing system is designed so that you may send the same piece of mail to
  26. local users AND network users all at once simply by creating the message and
  27. it's header and then writing one or more MailToList structures for each
  28. intended recipient.
  29.  
  30.  
  31. 1.1. The MailToList recipient file
  32. ----------------------------------
  33. naming convention:   xxxxxxxx.mtl
  34.  
  35. The contents of #?.mto files are arranged so that one piece of email can be
  36. sent to many users, local and outbound network addresses are allowed.  The
  37. first line of the .mto file is the full path/name of the .cmh file that
  38. contains the mail to be sent to the users listed in the .mtl file.
  39. (ie. "mail:cnetoutbox/12345678.cmh\n" )
  40.  
  41. The .cmh file path/name is followed by one or more instances of the MailToList
  42. structure found in mail.h.  For each instance of MailToList structure, a
  43. corresponding copy of the mail contained in the .cmh file will be sent to
  44. the user/network address specified.
  45.  
  46. The "Name" variable
  47. -------------------
  48. Each MailToList structure may contain a valid handle or realname for local
  49. users or a fulll network address.  These attributes are placed in the Name
  50. variable of the MailToList structure.
  51.  
  52. The "UUCP" variable
  53. -------------------
  54. This is an optional field.  mail-task will find the most current UUCP id for
  55. the user specified in the "Name" variable if no UUCP is given).  For network
  56. addresses, internet and fido alike, DO NOT specify a UUCP name but DO fill
  57. out the MailType and Name variables of the MailToList structure with the FULL
  58. NETWORK ADDRESS of the intended recipient.
  59.  
  60. Also, pay heed to the "MailType" variable.  There are currently 6 types.
  61.  
  62.  
  63. 1.2 MailToList "MailTypes"
  64. --------------------------
  65. The MailType in the MailToList structure is designed to tell mail-task
  66. what type of mail is being sent for that specific MailTo as well as
  67. how to address the recipient, whether by RealName or Handle (for local users)
  68. For network mails, Mail-task will always use the specific "Name" but be
  69. sure to set the appropriate MailType to specify whether mail-task should
  70. send the mail to am internet or FTS (fidonet) address (types 2 and 3,
  71. respectively).  You may even specify NEWUSER or FEEDBACK items (which
  72. generally should be refrained from using, but the capability exists
  73. for a more well-rounded complete implementation.
  74.  
  75. If you use the "Local Alias" MailType, be sure to fill out the UUCP id of
  76. the recepient.  mail-task currently, does not "track" individial aliases for
  77. each user, but may do so in the future.
  78.  
  79. The "next" field may be ignored.  This is set dynamically by CNet when it
  80. must allocate a "list" of MailTypes for carbon-copy and Multi-Mail
  81. scenarios.
  82.  
  83.  
  84.  
  85. Notes and concerns:
  86. -------------------
  87.    If you are going to write a .mtl file "on the fly" then please use a
  88. temporary extension until the file is completely written and THEN rename it
  89. with an .mtl extension (CNet uses an .mtt extension as a temporary extension
  90. but you may use whatever you like).  mail-task will not "see" the mailtolist
  91. file until it has an .mtl extension.  So be sure to write ALL files before
  92. renaming your temporary mailtofile with an .mtl extension so that mail-task
  93. does not try and read your .mtl file until your mail file(s) are complete.
  94.  
  95.  
  96. Summary
  97. -------
  98. 1. Sending Netmail OUT through mail-task:
  99.  
  100.    - fill out a MailHeader4 with the appropriate fields filled in.
  101.    - fill out a MailToList structure as follows:
  102.  
  103.       Set the Name field as the user's FULL network address
  104.       Clear the UUCP field (ie. mailtolist.UUCP[0]=0;)
  105.       Set the MailType according to the following
  106.  
  107.         MailType =  3 for a fidonet outbound mail
  108.                  =  2 for an internet/compuserve/aol/etc mail
  109.  
  110.    - Save your MailHeader4 structure as mail:cnetoutbox/xxxxxxxx.cmh 
  111.      where the xxxxxxxx is unique from all other current .cmh files in
  112.      mail:cnetoutbox.
  113.    - Save the full path and name of the .cmh file in a file called
  114.      mail:cnetoutbox/xxxxxxxx.mtl and Be sure to terminate the filename
  115.      written to the .mtl file with a SINGLE \n (DECIMAL 10, HEX 0x0A)
  116.      Following the cmhfilename, write your MailToList structure to the .mtl
  117.      file as well.
  118.  
  119.      Note: To write the structures to disk, it's best to use either the DOS
  120.            Write() function (if you opened the file using the AmigaDOS Open()
  121.            function) or use fwrite() if you opened the file using the ANSI
  122.            fopen() function.
  123.  
  124. 2. Sending mail to LOCAL users through mail-task:
  125.  
  126.    - fill out a MailHeader4 with the appropriate fields filled in.
  127.  
  128.       It is MOST IMPORTANT that you fill in the ByID and ByAccount
  129.       variables of the MailHeader4 structure.  To ToID and ToAccount
  130.       should be set by mail-task but you may fill these in also, to
  131.       be sure of the destination and to allow mail-bouncing to work
  132.       properly.
  133.  
  134.    - fill out a MailToList structure as follows:
  135.  
  136.       Set the Name field as the user's LOCAL handle or Real Name
  137.  
  138.       Set the UUCP field to the user's UUCP name (or you can leave
  139.       this the UUCP field blank and mail-task will find the most current
  140.       UUCP name for the user).  Note that if you leave the UUCP field blank
  141.       and if the user changes his/her handle, mail-task may not be able to
  142.       find his/her account and the mail will never be received.  It is best to
  143.       fill out the UUCP name.
  144.  
  145.       Set the MailType according to the following
  146.  
  147.         MailType =  0 for mail to be sent using the sending user's real name.
  148.                     1 for mail to be sent using the sending user's Handle.
  149.                     4 for mail to be sent using an alias (ie. the sending
  150.                       user used someone else's handle/name.
  151.                     5 for mail to be sent using a handle derived from the
  152.                       FindAccount() "handle/name list" that CNet pops
  153.                       up when a user cannot be found.
  154.                     6 for mail to be sent to feedback.
  155.                     7 for mail to be sent to the sysop NEWUSER folder (ie new user applications
  156.                     8 for mail to be sent to the sysop MSGS-TO-SYSOP folder
  157.  
  158.          Notes regarding FEEDBACK, NEWUSER and MSGS-TO-SYSOP mail:
  159.  
  160.            - The UUCP field of the MailToList structure must be set to SYSOP.
  161.            - The Name field must be set to either FEEDBACK, NEWUSER or
  162.              SYSOP (for msgs-to-sysop).
  163.  
  164.    - Save your MailHeader4 structure as mail:cnetoutbox/xxxxxxxx.cmh 
  165.      where the xxxxxxxx is unique from all other current .cmh files in
  166.      mail:cnetoutbox.
  167.    - Save the full path and name of the .cmh file in a file called
  168.      mail:cnetoutbox/xxxxxxxx.mtl and Be sure to terminate the filename
  169.      written to the .mtl file with a SINGLE '\n'
  170.      Following the cmhfilename, write your MailToList structure(s) to the .mtl
  171.      file as well.
  172.  
  173.      Note: To write the structures to disk, it's best to use either the DOS
  174.            Write() function (if you opened the file using the AmigaDOS Open()
  175.            function) or use fwrite() if you opened the file using the ANSI
  176.            fopen() function.
  177.  
  178.  
  179.  
  180. ****** PLEASE DO NOT file items directly to user folders.  Use mail-task.
  181.        If the format of the folders changes in the future, you may corrupt
  182.        items in user folders by filing items directly to them, even though
  183.        they do use the same MailHeader4 format, currrently!
  184.